{include file=$header_start}
{strip}
<script type="text/javascript" src="{$siteroot}/includes/js/admin/checkall.js" /></script>
<script src="{$siteroot}/includes/js/admin/ajax.js" type="text/javascript" ></script>
{/strip}
{include file=$header_end}
{literal}
<script type="text/javascript">
$(function(){
$(".someClass").tipTip();
});

$(function(){
$(".someClass").tipTip({maxWidth: "auto", edgeOffset: 10});
});
</script>
<script type="text/javascript">
// This function is fetch state by country id
/*function showState(cid){
	ajax.sendrequest("GET",SITEROOT + "/admin/city/show_state1.php",{cid:cid},"","isShowState");
}
*/</script>
{/literal}
 <div class="contain">
 
      {include file=$left_menu}
      
      <div class="right_contain">
        
         <div class="heading_box">Manage City <a href="javascript:;" class="someClass" title="{$moduelArray.module_help_text}" style="float:right;"><img src="{$siteroot}/templates/admin/img/topic_icon6.png" /></a></div>
         <div class="whitebox">
         
         <!--Message Div Start-->
         {if $msg}
         <div class="masg_div">
         	{$msg}
         </div>
         {/if}
         <!--Message Div End-->
         
         <div>
          <!--Form Contain start-->
           
           <div class="table_viewbox">
            <!--<h2>Table Design</h2>-->
            <form name="searchFrm" id="searchFrm" method="post" action="{$siteroot}/admin/home.php?q=city">
            	<table width="100%" border="0" cellpadding="3" cellspacing="5">
                	<tr>
                    	<td align="left"><input type="button" name="add" id="add" value="Add City" class="admin_btn" onclick="javascript: window.location='{$siteroot}/admin/home.php?q=addcity';" /></td>
                        <td align="right"><!--<select class="input41_selet" name="search_country" id="search_country" onchange="showState(this.value);">
                        <option value="">Select Country</option>
                        /*{section name=i loop=$countryArr}
                        <option value="{$countryArr[i].country_id}" {if $search_country eq $countryArr[i].country_id} selected="selected" {/if}>{$countryArr[i].country_name|ucfirst}</option>
                        {/section}*/
                        </select>-->
                        <span id="isShowState">
                          <select class="input41_selet" name="search_state" id="search_state">
                        <option value="">Select State</option>
                        {section name=i loop=$stateArr}
                        <option value="{$stateArr[i].state_id }" {if $search_state eq $stateArr[i].state_id} selected="selected" {/if}>{$stateArr[i].state_name|ucfirst}</option>
                        {/section}
                        </select>           
                        </span>            
                        &nbsp;<input type="text" name="search" id="search" class="input26" value="{if $search neq ''}{$search}{else}City{/if}" onfocus="this.value=''" onblur="if(this.value=='')this.value='City'" />&nbsp;<input type="submit" name="add" id="add" value="Search" class="admin_btn" />&nbsp;<input type="button" name="add" id="add" value="Clear" class="admin_btn" onclick="javascript: window.location='{$siteroot}/admin/home.php?q=city';" /></td>
                    </tr>
                    
                </table>
            </form>
            
            
            <form name="frm" id="frm" action="" method="post" >
            <input type="hidden" name="hidden_pageno" id="hidden_pageno" value="{$page}" />
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_viewbox">
              <tr>
                <th width="3%" align="center">#</th>
                <th width="3%"><input type="checkbox" name="check" id="check"  /></th>
                <th width="25%">
                	<div class="lF"><a {if $smarty.get.col1|base64_decode eq '0'} href="{$siteroot}/admin/home.php?q=city&col1={1|base64_encode}&page={$page}" {else}href="{$siteroot}/admin/home.php?q=city&col1={0|base64_encode}&page={$page}" {/if}>City Name</a></div>
                	<div class="lF" style="margin-left:10px;  height:15px;">
                    	<div style="width:10px; height:6px;"><a href="{$siteroot}/admin/home.php?q=city&col1={0|base64_encode}&page={$page}" ><img {if $smarty.get.col1|base64_decode eq '1' || $smarty.get.col2 neq '' || $smarty.get.col3 neq ''} src="{$siteroot}/templates/admin/img/admin_toparrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_toparrow_black.png" {/if} title="ASC"  width="10" height="6" align="top"/></a> <br /></div>
                        <div style="width:10px; height:6px; margin-top:3px; *margin-top:4px;"><a href="{$siteroot}/admin/home.php?q=city&col1={1|base64_encode}&page={$page}"><img {if $smarty.get.col1|base64_decode eq '0' || $smarty.get.col1|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_downarrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_downarrow_black.png" {/if} title="DESC"  width="10" height="6" align="bottom" /></a></div>
                    </div>
                    <div class="clear"></div>   	
                </th>
                <th width="25%">
                	<div class="lF"><a {if $smarty.get.col2|base64_decode eq '0'} href="{$siteroot}/admin/home.php?q=city&col2={1|base64_encode}&page={$page}" {else}href="{$siteroot}/admin/home.php?q=city&col2={0|base64_encode}&page={$page}" {/if}>State Name</a></div>
                	<div class="lF" style="margin-left:10px;  height:15px;">
                    	<div style="width:10px; height:6px;"><a href="{$siteroot}/admin/home.php?q=city&col2={0|base64_encode}&page={$page}" ><img {if $smarty.get.col2|base64_decode eq '1' || $smarty.get.col2|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_toparrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_toparrow_black.png" {/if} title="ASC"  width="10" height="6" align="top"/></a> <br /></div>
                        <div style="width:10px; height:6px; margin-top:3px; *margin-top:4px;"><a href="{$siteroot}/admin/home.php?q=city&col2={1|base64_encode}&page={$page}"><img {if $smarty.get.col2|base64_decode eq '0' || $smarty.get.col2|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_downarrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_downarrow_black.png" {/if} title="DESC"  width="10" height="6" align="bottom" /></a></div>
                    </div>
                    <div class="clear"></div>                 
				</th>
                <th width="25%">Country Name
	                <!--<div class="lF"><a {if $smarty.get.col3|base64_decode eq '0'} href="{$siteroot}/admin/home.php?q=city&col3={1|base64_encode}&page={$page}" {else}href="{$siteroot}/admin/home.php?q=city&col3={0|base64_encode}&page={$page}" {/if}>Country</a></div>
                	<div class="lF" style="margin-left:10px;  height:15px;">
                    	<div style="width:10px; height:6px;"><a href="{$siteroot}/admin/home.php?q=city&col3={0|base64_encode}&page={$page}" ><img {if $smarty.get.col3|base64_decode eq '1' || $smarty.get.col3|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_toparrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_toparrow_black.png" {/if} title="ASC"  width="10" height="6" align="top"/></a> <br /></div>
                        <div style="width:10px; height:6px; margin-top:3px; *margin-top:4px;"><a href="{$siteroot}/admin/home.php?q=city&col3={1|base64_encode}&page={$page}"><img {if $smarty.get.col3|base64_decode eq '0' || $smarty.get.col3|base64_decode eq ''} src="{$siteroot}/templates/admin/img/admin_downarrow_white.png" {else} src="{$siteroot}/templates/admin/img/admin_downarrow_black.png" {/if} title="DESC"  width="10" height="6" align="bottom" /></a></div>
                    </div>
                    <div class="clear"></div>-->
                </th>
                <th width="15%">Action</th>
              </tr>
               {if $cityArray}
              {section name=i loop=$cityArray}
              <tr class="inactiverow" id="tr_{$cityArray[i].id}">
                <td align="center">{$newid}</td>
                <td><input type="checkbox" name="checkall[]" id="checkall_{$smarty.section.i.iteration}" value="{$cityArray[i].city_id}" /></td>
                <td>{$cityArray[i].city_name|ucfirst}</td>
                <td>{$cityArray[i].state_name|ucfirst}</td>
                <td>{$cityArray[i].country_name|ucfirst}</td>
                <td>
                    <span>
                    	{if $cityArray[i].city_status eq '1'}
                    			<a href="{$siteroot}/admin/home.php?q=city&id={$cityArray[i].city_id|base64_encode}&action=status&status={$cityArray[i].city_status}&page={$page}" onclick="javascript:return confirm('Are you sure do you want to change status?');" title="Currently Active"><img src="{$siteroot}/templates/admin/img/icon_correct.png" /></a>
                        {else}
                        		<a href="{$siteroot}/admin/home.php?q=city&id={$cityArray[i].city_id|base64_encode}&action=status&status={$cityArray[i].city_status}&page={$page}" onclick="javascript:return confirm('Are you sure do you want to change status?');" title="Currently Inactive"><img src="{$siteroot}/templates/admin/img/close.png" /></a>
                        {/if}
                    </span>
                    
                    <span><a href="{$siteroot}/admin/home.php?q=editcity&id={$cityArray[i].city_id|base64_encode}&action=edit&page={$page}"><img src="{$siteroot}/templates/admin/img/icon_edit.png" title="Edit City " /></a></span>
                    <span><a href="{$siteroot}/admin/home.php?q=city&id={$cityArray[i].city_id|base64_encode}&action=delete&page={$page}" onclick="javascript:return confirm('Are you sure do you want to delete this record?');" title="Delete City"><img src="{$siteroot}/templates/admin/img/icon-delete.png" /></a></span>
                </td>
              </tr>
              <!-- {$newid++} -->
              {/section}
               {else}
              <tr>
               <td colspan="6" align="center" class="error">Record Not Found</td>
              </tr>
              {/if}
               <tr>
                <td colspan="6">
                {if $cityArray}
                <div class="select_box">
                <select name="action" id="action" class="input width">
                  <option value="">Select</option>
                  <option value="active">Active</option>
                  <option value="inactive">Inactive</option>
                  <option value="delete">Delete</option>
                  </select>&nbsp;<input type="submit" class="admin_btn" value="Go" name="go" id="go" /><div id="errormsg" class="error"></div> 
                  
                  </div>
                  {/if}
                  <div class="pagination">
                  {if $pagination}{$pagination}{/if}
                  </div>
                   </td>
                  
              </tr>
            </table>
</form>
            

         </div>
            <!--Form Contain end--> 
          
         </div>
         
         
         </div>
        </div>
      
      
      <!--right_contain end-->
      <div class="clear"></div>
    </div>
    
{include file=$footer}